import { ajax } from '../http.js';
// import { ajaxSync } from '../httpSync.js';

const findStoreListUrl = '/authc/store_resource_search/find_store_list';
const findStoreTypeUrl = '/store_resource/find_all';
const findHotCityUrl = '/store_resource/store_hot_city'; // 热门城市
const hotSearchUrl = '/store_resource/store_hot_search'; // 热门搜索
const getProductSearchUrl = '/authc/store_resource_search/find_store_search'; // 获取搜索记录
const deleteSearchUrl = '/authc/store_resource_search/delete_store_search'; // 搜索记录删除

const findStoreList = (data, success, fail) => // 找店(获取店铺信息)
  ajax({
    url: findStoreListUrl,
    data: data,
    success: success,
    fail: fail
  });
const findStoreType = (data, success, fail) => // 获取店铺类型
  ajax({
    url: findStoreTypeUrl,
    data: data,
    success: success,
    fail: fail
  });
const findHotCity = (data, success, fail) => // 热门城市
  ajax({
    url: findHotCityUrl,
    data: data,
    success: success,
    fail: fail
  });
const hotSearch = (data, success, fail) => // 热门搜索
  ajax({
    url: hotSearchUrl,
    data: data,
    success: success,
    fail: fail
  });
const getProductSearch = (data, success, fail) => // 获取搜索记录
  ajax({
    url: getProductSearchUrl,
    data: data,
    success: success,
    fail: fail
  });
const deleteSearch = (data, success, fail) => // 搜索记录删除
  ajax({
    url: deleteSearchUrl,
    data: data,
    success: success,
    fail: fail
  });

export {
  findStoreList,
  findStoreType,
  findHotCity,
  hotSearch,
  getProductSearch,
  deleteSearch
}